<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.min.js"></script>
<script src="https://cdn.bootcss.com/axios/0.19.2/axios.min.js"></script>
</head>
<body>
	<div id="app">
		<button @click="getTestData">Test</button>
		<h1 v-text="data"></h1>
	</div>
</body>
<script type="text/javascript">
	new Vue({
		el: "#app",
	    data(){
	      return {
	          data : "test",
	      }  
	    },
	    methods:{
	    	getTestData(){
	    		let _this = this
	    		var header = {
    				headers: {
    					'Content-type': 'application/json',
    					"tokenzsk1":"testToken"
    				}
    			}
	    		axios.get('/services/test',header)
	    		.then(function (response) {
	    			_this.data = response.data
	    		})
	    		.catch(function (error) {
	    			_this.data = JSON.stringify(error)
	    		})
	    		.then(function () {
	    			//console.info("always executed")
	    		})
	    	}
	    }
	})
</script>
</html>